<template>
  <div>
    <img src="../../assets/img/logo3.png" alt="">
    <el-card>
      <el-button type="success" icon="el-icon-plus" @click="show">上传</el-button>
    </el-card>

    <el-button type="success" icon="" @click="hello">hello</el-button>
    <FileAdd :addOrUpdateVisible="addOrUpdateVisible" @changeShow="showAddOrUpdate"></FileAdd>
  </div>
</template>

<script>
  import FileAdd from '../system/files/FileAdd'
  import { hello } from '../../api/system/test'

  export default {
    props: {},
    name: 'Welcome',
    data () {
      return {
        addOrUpdateVisible: false,
      }
    },
    components: {
      FileAdd
    },
    methods: {

      async hello () {
        const { data: res } = await hello().then(res => {
          if (res) {
            this.$message.success(res.data.data.str)
          }
        })
      },
      show () {
        this.addOrUpdateVisible = true
      },

      // 监听 子组件弹窗关闭后触发，有子组件调用
      showAddOrUpdate (data) {
        this.addOrUpdateVisible = data !== 'false'
      }
    }
  }
</script>


<style scoped>

</style>
